//
//  TypePHCell.m
//  LiWuShuo
//
//  Created by 袁小航 on 14/11/15.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "TypePHCell.h"
#import "Define.h"
#import "TypePHCollectioCell.h"

@implementation TypePHCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
//        创建“对象”和“兴趣”的collectionview
        [self createPHCollectionView];
        
    }
    return self;
}

#pragma mark - 创建“对象”和“兴趣”的collectionview
- (void)createPHCollectionView
{
    self.PHLayout = [[UICollectionViewFlowLayout alloc]init];
    _PHLayout.itemSize = CGSizeMake(TYPE_PH_ITEM_WIDTH, TYPE_PH_ITEM_HEIGHT);
    _PHLayout.sectionInset = UIEdgeInsetsMake(TYPE_PH_INSET_TOP, TYPE_PH_INSET_LEFT, TYPE_PH_INSET_TOP, TYPE_PH_INSET_LEFT);
    
    self.PHCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, 320, 300) collectionViewLayout:_PHLayout];
    _PHCollectionView.scrollEnabled = NO;
    _PHCollectionView.backgroundColor = [UIColor whiteColor];
    [_PHCollectionView registerClass:[TypePHCollectioCell class] forCellWithReuseIdentifier:@"personCell"];
    [_PHCollectionView registerClass:[TypePHCollectioCell class] forCellWithReuseIdentifier:@"hobbyCell"];
    
    [self.contentView addSubview:_PHCollectionView];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
